package com.upbos.upm.common.cat;


import com.upbos.data.core.SingleDao;
import com.upbos.upm.entity.Category;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

/**
 * <b>Application name：</b> CategoryDao.java <br>
 * <b>Application describing: 分类管理Dao</b> <br>
 * <b>Copyright：</b> Copyright &copy; 2015-2020 yideb.com<br>
 * <b>Company：</b> yideb.com <br>
 * <b>Date：</b> 2019年04月12日 16:05 <br>
 * <b>author：</b> <a href="mailto:wangjz@miyzh.com"> Jason </a>
 * <b>version：</b>V4.*
 */
@Repository
public class CategoryDao {
    @Resource
    private SingleDao singleDao;

    public List<Category> listCategory(Integer type) {
        return singleDao.queryList("CommonDaoMapper.listCategory", type);
    }

    public void insertCategory(Category category) {
        singleDao.insert(category);
    }

    public void deleteCategory(Long id) {
        Category category = new Category();
        category.setId(id);
        singleDao.deleteById(category);
    }

}
